object frmVariacion: TfrmVariacion
  Left = 90
  Top = 51
  Width = 778
  Height = 549
  Caption = 'Variaci'#243'n'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  DesignSize = (
    770
    515)
  PixelsPerInch = 96
  TextHeight = 13
  object lblFechaIni: TLabel
    Left = 228
    Top = 16
    Width = 28
    Height = 13
    Caption = 'Inicio:'
  end
  object lblFechaFin: TLabel
    Left = 353
    Top = 16
    Width = 25
    Height = 13
    Caption = 'Final:'
  end
  object Label2: TLabel
    Left = 552
    Top = 488
    Width = 33
    Height = 13
    Anchors = [akRight, akBottom]
    Caption = 'Filtro:'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clNavy
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object DBText1: TDBText
    Left = 312
    Top = 488
    Width = 44
    Height = 16
    AutoSize = True
    DataField = 'promVar'
    DataSource = s
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Arial Narrow'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label3: TLabel
    Left = 232
    Top = 480
    Width = 65
    Height = 29
    Alignment = taRightJustify
    Anchors = [akLeft, akBottom]
    Caption = 'Variaci'#243'n Promedio:'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clNavy
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
    WordWrap = True
  end
  object edtFechaIni: TDateEdit
    Left = 264
    Top = 10
    Width = 79
    Height = 21
    Ctl3D = False
    DefaultToday = True
    DialogTitle = 'Seleccione una Fecha'
    NumGlyphs = 2
    ParentCtl3D = False
    YearDigits = dyTwo
    TabOrder = 0
    Text = '07/12/06'
    OnChange = edtFechaIniChange
  end
  object edtFechaFin: TDateEdit
    Left = 386
    Top = 10
    Width = 85
    Height = 21
    Ctl3D = False
    DefaultToday = True
    NumGlyphs = 2
    ParentCtl3D = False
    YearDigits = dyTwo
    TabOrder = 1
    Text = '07/12/06'
    OnChange = edtFechaIniChange
  end
  object grdMaterial: TRxDBGrid
    Left = 224
    Top = 37
    Width = 536
    Height = 436
    Anchors = [akLeft, akTop, akRight, akBottom]
    DataSource = s
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'Tahoma'
    Font.Style = []
    Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgConfirmDelete, dgCancelOnExit, dgMultiSelect]
    ParentFont = False
    PopupMenu = PopupMenu1
    ReadOnly = True
    TabOrder = 2
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clNavy
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = [fsBold]
    OnDrawColumnCell = grdMaterialDrawColumnCell
    OnTitleClick = grdMaterialTitleClick
    MultiSelect = True
    Columns = <
      item
        Expanded = False
        FieldName = 'MATERIAL'
        Title.Alignment = taCenter
        Width = 266
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'MINIMO'
        Title.Alignment = taCenter
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'MAXIMO'
        Title.Alignment = taCenter
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'PORCENT_VARIACION'
        Title.Alignment = taCenter
        Title.Caption = '% Var.'
        Visible = True
      end>
  end
  object Panel1: TPanel
    Left = 0
    Top = 0
    Width = 225
    Height = 515
    Align = alLeft
    BevelOuter = bvNone
    Color = clInactiveBorder
    TabOrder = 3
    DesignSize = (
      225
      515)
    object Label1: TLabel
      Left = 8
      Top = 488
      Width = 33
      Height = 13
      Anchors = [akLeft, akBottom]
      Caption = 'Filtro:'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clNavy
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object RxDBGrid1: TRxDBGrid
      Left = 4
      Top = 37
      Width = 213
      Height = 436
      Anchors = [akLeft, akTop, akRight, akBottom]
      DataSource = sProveedor
      Font.Charset = ANSI_CHARSET
      Font.Color = clWindowText
      Font.Height = -12
      Font.Name = 'Tahoma'
      Font.Style = []
      Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgConfirmDelete, dgCancelOnExit, dgMultiSelect]
      ParentFont = False
      ReadOnly = True
      TabOrder = 0
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clNavy
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = [fsBold]
      MultiSelect = True
      Columns = <
        item
          Expanded = False
          FieldName = 'RAZON'
          Title.Alignment = taCenter
          Width = 175
          Visible = True
        end>
    end
    object edtFiltroProveedor: TEdit
      Left = 96
      Top = 482
      Width = 121
      Height = 21
      Anchors = [akRight, akBottom]
      CharCase = ecUpperCase
      TabOrder = 1
      OnChange = edtFiltroProveedorChange
    end
  end
  object edtFiltroMaterial: TEdit
    Left = 640
    Top = 482
    Width = 121
    Height = 21
    Anchors = [akRight, akBottom]
    CharCase = ecUpperCase
    TabOrder = 4
    OnChange = edtFiltroMaterialChange
  end
  object cds: TSQLClientDataSet
    CommandText = 
      'SELECT '#13#10'  COMPRA.ID_PROVEEDOR,'#13#10'  RENGLON_COMPRA_NEW.ID_MATERIA' +
      'L,'#13#10'  RENGLON_COMPRA_NEW.MATERIAL,  MAX(RENGLON_COMPRA_NEW.UNITA' +
      'RIO*(1-COMPRA.DESCUENTO/100)) AS MAXIMO,  MIN(RENGLON_COMPRA_NEW' +
      '.UNITARIO*(1-COMPRA.DESCUENTO/100)) AS MINIMO,  (MAX(RENGLON_COM' +
      'PRA_NEW.UNITARIO*(1-COMPRA.DESCUENTO/100))-MIN(RENGLON_COMPRA_NE' +
      'W.UNITARIO*(1-COMPRA.DESCUENTO/100)))'#13#10'  /MIN(RENGLON_COMPRA_NEW' +
      '.UNITARIO*(1-COMPRA.DESCUENTO/100))*100 AS PORCENT_VARIACION,'#13#10'S' +
      'UM(RENGLON_COMPRA_NEW.CANTIDAD) AS CANT'#13#10'FROM'#13#10'  PROVEEDOR'#13#10'  IN' +
      'NER JOIN COMPRA ON (PROVEEDOR.ID_PROVEEDOR = COMPRA.ID_PROVEEDOR' +
      ')'#13#10'  INNER JOIN PRESUPUESTO ON (COMPRA.ID_OBRA = PRESUPUESTO.ID_' +
      'PRESUPUESTO)'#13#10'  INNER JOIN RENGLON_COMPRA_NEW ON (COMPRA.ID_COMP' +
      'RA = RENGLON_COMPRA_NEW.ID_COMPRA)'#13#10'WHERE'#13#10'  COMPRA.ID_PROVEEDOR' +
      ' = :id'#13#10'  AND COMPRA.FECHA >= :fechaini'#13#10'  AND COMPRA.FECHA <= :' +
      'fechafin'#13#10'GROUP BY'#13#10'  COMPRA.ID_PROVEEDOR,'#13#10'  RENGLON_COMPRA_NEW' +
      '.ID_MATERIAL,'#13#10'  RENGLON_COMPRA_NEW.MATERIAL'#13#10'HAVING'#13#10' MAX(RENGL' +
      'ON_COMPRA_NEW.UNITARIO) <> MIN(RENGLON_COMPRA_NEW.UNITARIO)'
    Aggregates = <>
    AggregatesActive = True
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <
      item
        DataType = ftUnknown
        Name = 'id'
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'fechaini'
        ParamType = ptInput
      end
      item
        DataType = ftUnknown
        Name = 'fechafin'
        ParamType = ptInput
      end>
    BeforeOpen = cdsBeforeOpen
    DBConnection = Datos.Con
    Left = 16
    Top = 344
    object cdsID_PROVEEDOR: TSmallintField
      FieldName = 'ID_PROVEEDOR'
      Required = True
    end
    object cdsID_MATERIAL: TFloatField
      FieldName = 'ID_MATERIAL'
      Required = True
    end
    object cdsMATERIAL: TStringField
      DisplayLabel = 'Material'
      FieldName = 'MATERIAL'
      Required = True
      Size = 50
    end
    object cdsMAXIMO: TFloatField
      DisplayLabel = 'M'#225'ximo'
      FieldName = 'MAXIMO'
      DisplayFormat = '#,###,##0.00'
    end
    object cdsMINIMO: TFloatField
      DisplayLabel = 'M'#237'nimo'
      FieldName = 'MINIMO'
      DisplayFormat = '#,###,##0.00'
    end
    object cdsPORCENT_VARIACION: TFloatField
      DisplayLabel = 'Var. %'
      FieldName = 'PORCENT_VARIACION'
      DisplayFormat = '#,###,##0.00'
    end
    object cdsCANT: TFloatField
      FieldName = 'CANT'
    end
    object cdspromVar: TAggregateField
      FieldName = 'promVar'
      Active = True
      DisplayFormat = '#,###,##0.00'
      Expression = 'sum(porcent_variacion)/count(porcent_variacion)'
    end
  end
  object s: TDataSource
    DataSet = cds
    Left = 48
    Top = 344
  end
  object cdsProveedor: TSQLClientDataSet
    CommandText = 'select ID_PROVEEDOR, RAZON from PROVEEDOR'#13#10'where TANTERO = '#39'0'#39
    Aggregates = <>
    AggregatesActive = True
    IndexFieldNames = 'RAZON'
    Options = [poAllowCommandText]
    ObjectView = True
    Params = <>
    AfterScroll = cdsProveedorAfterScroll
    DBConnection = Datos.Con
    Left = 16
    Top = 376
    object cdsProveedorID_PROVEEDOR: TSmallintField
      FieldName = 'ID_PROVEEDOR'
      Required = True
    end
    object cdsProveedorRAZON: TStringField
      DisplayLabel = 'Raz'#243'n Social'
      FieldName = 'RAZON'
      Required = True
      Size = 40
    end
  end
  object sProveedor: TDataSource
    DataSet = cdsProveedor
    Left = 48
    Top = 376
  end
  object PopupMenu1: TPopupMenu
    Left = 80
    Top = 344
    object Verdetalle1: TMenuItem
      Caption = 'Ver detalle...'
      OnClick = Verdetalle1Click
    end
  end
end
